package com.ke.jdyd.service;

import com.ke.jdyd.http.BaseResponse;
import com.ke.jdyd.http.RetrofitFactory;
import com.ke.jdyd.model.GoodsEntity;

import io.reactivex.Observable;
import retrofit2.http.GET;
import retrofit2.http.Query;

public class DetailService {

    private DetailService.GoodApi mApi;

    public DetailService() {
        mApi = new RetrofitFactory().getApi(DetailService.GoodApi.class);
    }

    public Observable<BaseResponse<GoodsEntity>> getGoodsDetail(String id) {
        return mApi.getGoodsDetail(id);
    }

    public interface GoodApi {

        /**
         * 获取商品详情
         * @param id 商品id
         * @return
         */
        @GET("api/apiIndex/getGoodsDetail/")
        Observable<BaseResponse<GoodsEntity>> getGoodsDetail(@Query("id") String id);
    }
}
